function   up
 
    global b d p g Rf OA         %%% 常数         
    global Bo II u ii            %%% 时间向量，方位角向量     
    global H W h Ds Dm Os Om     %%% 参数向量          
    global PointSet_three_Bo_u   %%% 三相线点集 
    global PointSet_down_Bo_u_O  %%% 气液面下部点集    
    global PointSet_up_Bo_u_O    %%% 气液面上部点集        
    %%% 特殊 全局变量
    global Point_r_three_Bo_u  Point_z_three_Bo_u  a_down_Bo_u    
   
    a=acos(1-h/Rf); % 只在本函数中使用的系数 a
    k=tan(pi-Os-a); % 只在本函数中使用的系数 k
   
   for N=1:II
      for n=1:ii   
        CoreZ_up_Bo_u(N,n)=-H(1,N)+0.5*Ds(1,N); %时间为Bo，方位角为u时，up椭圆曲线中心的Z坐标
      end
   end

   for N=1:II   
     for n=1:ii 
          if N~=1
          a_up_Bo_u1=((Point_r_three_Bo_u(N,1)-0.5*Ds(1,N))*(Point_z_three_Bo_u(N,1)+H(1,N)-0.5*Ds(1,N))...,
                  -k(1,N)*(Point_r_three_Bo_u(N,1)-0.5*Ds(1,N)).^2)/...,
                  (2*k(1,N)*(Point_r_three_Bo_u(N,1)-0.5*Ds(1,N))-(Point_z_three_Bo_u(N,1)+H(1,N)-0.5*Ds(1,N)));
              
          b_up_Bo_u1=sqrt((-k(1,N)*a_up_Bo_u1.^2*(Point_z_three_Bo_u(N,1)+H(1,N)-0.5*Ds(1,N)))/...,
                  (Point_r_three_Bo_u(N,1)-0.5*Ds(1,N)+a_up_Bo_u1));
                  
          a_up_Bo_u(N,n)= (-Point_r_three_Bo_u(N,n)+0.5*Ds(1,N)) / ...,                              
                   (1-sqrt(1-(Point_z_three_Bo_u(N,n)+H(1,N)-0.5*Ds(1,N))/(b_up_Bo_u1.^2)));
          %时间为Bo，方位角为u时，up椭圆曲线中心的半轴a
          b_up_Bo_u(N,n)=sqrt(-(k(1,N)*a_up_Bo_u1.^2*(Point_z_three_Bo_u(N,1)+H(1,N)-0.5*Ds(1,N)))/...,
                  (Point_r_three_Bo_u(N,1)-0.5*Ds(1,N)+a_up_Bo_u1));
          %时间为Bo，方位角为u时，up椭圆曲线中心的半轴b
      
          else
            a_up_Bo_u1=0;
            b_up_Bo_u1=0;
            a_up_Bo_u(N,n)=0;
            b_up_Bo_u(N,n)=0;
          end  
              
         CoreR_up_Bo_u(N,n)=a_down_Bo_u(N,n)-a_up_Bo_u(N,n);
         %时间为Bo，方位角为u时，up椭圆曲线中心的r坐标
       if N~=1 
            x(N,n)=(Point_z_three_Bo_u(N,n)-CoreZ_up_Bo_u(N,n))/b_up_Bo_u(N,n);
            O_2=[0:x(N,n)/12:x(N,n)];
            O_1=sqrt(1-O_2.^2);
     
       else
          O_1=ones(1,ii);
          O_2=zeros(1,ii);
       end
           
         % 时间为Bo，方位角为u，转角为O时，up椭圆曲线上的点的x,y,z坐标
         Point_r_up_Bo_u_O= CoreR_up_Bo_u(N,n) + a_up_Bo_u(N,n) * O_1;
         Point_z_up_Bo_u_O=CoreZ_up_Bo_u(N,n) + b_up_Bo_u(N,n) * O_2;       
         Point_x_up_Bo_u_O=Point_r_up_Bo_u_O * cos(u(1,n));
         Point_y_up_Bo_u_O=Point_r_up_Bo_u_O * sin(u(1,n));
         PointSet_up_Bo_u_O(N:N,((n-1)*3*ii+1):n*3*ii)=[Point_x_up_Bo_u_O,Point_y_up_Bo_u_O,Point_z_up_Bo_u_O];
     end
   end
end
